from mediator import mediator
from mediator . tests . test_assistant import make_mediator_test_keyword_args

class gui_fake :
    def __init__ ( self ) :
        self . _received_move_focus_to_args = None
    def gui_move_focus_to ( self , widget ) :
        self . _received_move_focus_to_args = [ widget ]

class mediator_gui_move_focus_to_tests : 
    'mediator_gui_move_focus_to'
    def __init__ ( self , test ) :
        self . _test = test
        self . _gui = gui_fake ( )
        self . _mediator = mediator ( )
        self . _mediator . register_modules ( ** make_mediator_test_keyword_args \
            ( 'gui' 
            , self . _gui 
            , None
            ) )
    def test_gui_move_focus_to ( self ) :
        self . _mediator . gui_move_focus_to ( 'my widget' )
        self . _test . assume_equal ( self . _gui . _received_move_focus_to_args ,
            [ 'my widget'
            ] )
